package dataContracts;

import java.io.Serializable;

import client.ClientDirectory;

@SuppressWarnings("serial")
public class Command implements Serializable {
	// by default this command does nothing
	public Command.Type commandType = Command.Type.Invalid;
	public String commandBody = "";
	// this command needs to pass the entire directory object graph over the wire
	public SharedDirectory directoryInfo;
	
	public Command(Command.Type type, String command) {
		this(type, command, null);
	}
	
	public Command(Command.Type type, String command, SharedDirectory clientDirectory) {
		this.commandBody = command;
		this.commandType = type;
		this.directoryInfo = clientDirectory;
	}

	public enum Type {
		Broadcast,
		IsEqual,
		GetFile,
		RecvFile,
		Invalid,
		Synch,
		NewFile,
		UpdateFile,
		DeleteFile,
		ResolveDiff,
		MarkAsCurrent,
		SerializeTest,
		UploadFile,
		
		PrepareForDirectoryObject,
		SendDirectoryObject, 
		Register, 
		SyncAttributes
	}
}